<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

//require_once  ("zhanggui_db_tool.php");
/*
class mealTable
{
    function mealPage()
    {
        $this->db = new zhangguiDBTool();
    }
    
    function getMealPage($index, $count)
    {
        $data = $this->db->getMeals($index, $count);
        
        $html = "<table class=\"meal_table\" cellspacing=\"0\">";
        
        $html += $this->getHeader();
        $html += $this->getRows($index, $count, $html);
        
        $html += "</table>";
    }

    function getHeader()
    {
        $html = "<tr>";
        
        $html +="<th>编号</th>";
        $html += "<th>餐名</th>";
        $html += "<th>价格</th>";
        $html += "<th>口味</th>";
        $html += "<th>菜系</th>";
        $html += "<th>数量</th>";
        $html += "<th>是否过期</th>";
        $html += "<th>优惠信息</th>";
        
        $html += "</tr>";
        
        return $html;
    }
    
    function getRows($index, $count, &$html)
    {        
        $data = $this->db->getMeals($index, $count);
        while($row = each($data))
        {
            $html += "<tr>";
            $html += $this->generatetds($row, $html);
            $html += "</tr>";
        }
    }
    
    function generatetds($row, &$html)
    {        
        $id = $row[0];
        $name = $row[1];
        $price = $row[2];
        $flavor = $row[7];
        $serial = $row[8];
        $count = $row[12];
        
        $create_time = $row[9];
        $expire_time = $row[11];
        
        $promotion_begin = $row[14];
        $promotion_end = $row[15];
        $is_promotion = $row[16];
        $promotion_id = $row[17];
        
        
        $html = $this->generatetd($id);
        $html += $this->generatetd($name);
        $html += $this->generatetd($price);
        $html += $this->generatetd($flavor);
        $html += $this->generatetd($serial);
        $html += $this->generatetd($count);
        $html += $this->generatetd($name);
    }
    
    function generatetd($info)
    {
        $html += "<td>";
        $html += $info;
        $html += "</td>";
        
        return $html;
    }
}
*/
if(!isset($data))
return false;

?>

<div class="tab_content">
<div class="title">
    <h3>套餐列表</h3>
</div>
<div class="content">
    <table class="meal_table" cellspacing="0">
        <tr class ="table_tr">
            <th>编号</th>
            <th>餐名</th>
            <th>价格</th>
            <th>口味</th>
            <th>菜系</th>
            <th>数量</th>
            <th>是否过期</th>
            <th>优惠信息</th>
        </tr>
        <?
        //DisplayRowContent();
        while(isset($data["meals"]) && $data["meals"]->next())
        {
            echo "<tr>";
            
            echo "<td>";
            echo $data["meals"]->__data["id"];
            echo "</td>";
            
            echo "<td>";
            echo $data["meals"]->__data["name"];
            echo "</td>";
            
            echo "<td>";
            echo $data["meals"]->__data["price"];
            echo "</td>";
            
            echo "<td>";
            echo $data["meals"]->__data["taste_flavor"];
            echo "</td>";
            
            echo "<td>";
            echo $data["meals"]->__data["meal_serial"];
            echo "</td>";
            
            echo "<td>";
            echo $data["meals"]->__data["count"];
            echo "</td>";
            
            echo "<td>";
            echo "</td>";
            
            echo "<td>";
            echo "</td>";
            
            echo "</tr>";
        }
        ?>
        <tr>
            <td colspan ="8" align ="right" class="fpage">
            <?
            echo $data['fpage'];
            //echo 
            ?>
            </td>
        </tr>
    </table>
</div>
</div>